<!DOCTYPE html>
 <html>
 <head>
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 <% include("/WEB-INF/view/console/common/css.html"){}	%>
 <% include("/WEB-INF/view/console/common/js.html"){} 	%>
 <title></title>
 </head>
 <body> <nav class="navbar navbar-default navbar-fixed-top site-navbar" >
  <div class="navbar-header">
 <a class="navbar-brand" href="#">boComment</a>
 </div>
  </nav>
 <form name="boComment_form"  id="boComment_form" class="form-horizontal" style="margin-top: 60px;">
   <div class="form-group" >
 <label class="col-sm-2 control-label">内容</label>
 <div class="col-sm-6">
 <input  type="text"  name="content" id="content" class="form-control" check-type="required" value='${boComment.content!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">用户id</label>
 <div class="col-sm-6">
 <input  type="text"  name="proxyId" id="proxyId" class="form-control" check-type="required" value='${boComment.proxyId!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">评论图片</label>
 <div class="col-sm-6">
 <input  type="text"  name="images" id="images" class="form-control" check-type="required" value='${boComment.images!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">新鲜度</label>
 <div class="col-sm-6">
 <label><input checked='checked' auto_name='boComment_gradeFresh' type="radio"  name="gradeFresh" value="1"/>好</label>
 <label><input  auto_name='boComment_gradeFresh' type="radio"  name="gradeFresh" value="2"/>中</label>
 <label><input  auto_name='boComment_gradeFresh' type="radio"  name="gradeFresh" value="3"/>差</label>
  
 </div>
  </div>
 	<script type="text/javascript">
       $(function($){
       $('input[auto_name="boComment_gradeFresh"]').each(function(){
       if('${boComment.gradeFresh!}'==this.value){ 
             $(this).attr('checked','checked');
            }
           });
 	    });
 	</script> 
 <div class="form-group" >
 <label class="col-sm-2 control-label">产品包装</label>
 <div class="col-sm-6">
 <label><input checked='checked' auto_name='boComment_gradePack' type="radio"  name="gradePack" value="1"/>好</label>
 <label><input  auto_name='boComment_gradePack' type="radio"  name="gradePack" value="2"/>中</label>
 <label><input  auto_name='boComment_gradePack' type="radio"  name="gradePack" value="3"/>差</label>
  
 </div>
  </div>
 	<script type="text/javascript">
       $(function($){
       $('input[auto_name="boComment_gradePack"]').each(function(){
       if('${boComment.gradePack!}'==this.value){ 
             $(this).attr('checked','checked');
            }
           });
 	    });
 	</script> 
 <div class="form-group" >
 <label class="col-sm-2 control-label">干净度</label>
 <div class="col-sm-6">
 <label><input checked='checked' auto_name='boComment_gradeClean' type="radio"  name="gradeClean" value="1"/>好</label>
 <label><input  auto_name='boComment_gradeClean' type="radio"  name="gradeClean" value="2"/>中</label>
 <label><input  auto_name='boComment_gradeClean' type="radio"  name="gradeClean" value="3"/>差</label>
  
 </div>
  </div>
 	<script type="text/javascript">
       $(function($){
       $('input[auto_name="boComment_gradeClean"]').each(function(){
       if('${boComment.gradeClean!}'==this.value){ 
             $(this).attr('checked','checked');
            }
           });
 	    });
 	</script> 
 <div class="form-group" >
 <label class="col-sm-2 control-label">干净度</label>
 <div class="col-sm-6">
 <label><input checked='checked' auto_name='boComment_gradeTaste' type="radio"  name="gradeTaste" value="1"/>好</label>
 <label><input  auto_name='boComment_gradeTaste' type="radio"  name="gradeTaste" value="2"/>中</label>
 <label><input  auto_name='boComment_gradeTaste' type="radio"  name="gradeTaste" value="3"/>差</label>
  
 </div>
  </div>
 	<script type="text/javascript">
       $(function($){
       $('input[auto_name="boComment_gradeTaste"]').each(function(){
       if('${boComment.gradeTaste!}'==this.value){ 
             $(this).attr('checked','checked');
            }
           });
 	    });
 	</script> 
 <div class="form-group" >
 <label class="col-sm-2 control-label">订单id</label>
 <div class="col-sm-6">
 <input  type="text"  name="orderId" id="orderId" class="form-control" check-type="required" value='${boComment.orderId!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">商品id</label>
 <div class="col-sm-6">
 <input  type="text"  name="goodsId" id="goodsId" class="form-control" check-type="required" value='${boComment.goodsId!}' >
 </div>
  </div>
 
   <input type='hidden' name='id' id='id' value='${boComment.id!}'><input type='hidden' name='common_token' id='common_token' value='${common_token!}'>
 <div class="form-group" style="margin-bottom: 60px;"></div>
 </form>
 <script type="text/javascript">
 $(function($) {
    /*开启表单验证*/
 	$("#boComment_form").validation();
 });
 /*保存*/
 function saveZqForm(){
    if ($("#boComment_form").valid() == false) {
 	    return false;
    }
    var formObject=new Object();
    formObject.content=$('#content').val()==''?null:$('#content').val(); 
 formObject.proxyId=$('#proxyId').val()==''?null:$('#proxyId').val(); 
 formObject.images=$('#images').val()==''?null:$('#images').val(); 
 formObject.gradeFresh=($('input[name="gradeFresh"]:checked').val()==''?null:$('input[name="gradeFresh"]:checked').val()); 
 formObject.gradePack=($('input[name="gradePack"]:checked').val()==''?null:$('input[name="gradePack"]:checked').val()); 
 formObject.gradeClean=($('input[name="gradeClean"]:checked').val()==''?null:$('input[name="gradeClean"]:checked').val()); 
 formObject.gradeTaste=($('input[name="gradeTaste"]:checked').val()==''?null:$('input[name="gradeTaste"]:checked').val()); 
 formObject.orderId=$('#orderId').val()==''?null:$('#orderId').val(); 
 formObject.goodsId=$('#goodsId').val()==''?null:$('#goodsId').val(); 
 formObject.id=$('#id').val()==''?null:$('#id').val(); 
 
    var formObjectJson = JSON.stringify(formObject);
    $.post("${ctxPath}/console/bo_comment/save",
     {
           formObjectJson :formObjectJson,
 	   table_name :'boComment',
 	   common_token :$("#common_token").val()
     }, function(data) {
          $.alert({
 	      title: '提示',
 	      content: data.message,
 	      backgroundDismiss: false,
 	      confirmButton:"确定",
 	      autoClose: 'confirm|2000',
 		  confirm: function(){
            parent.$("#boComment").bootstrapTable("refresh");
            parent.art.dialog.get('id-dialog-boComment').close();
 		  }
 		});
     });
 }
 </script>
 <nav class="navbar navbar-default navbar-fixed-bottom site-navbar" >
 <div class="container" style="padding-top:10px;padding-bottom:10px;">
 <div class="nav navbar-nav navbar-right">
 <a href="#" class="btn btn-success"  onclick='saveZqForm()'>保存 </a>
  </div>
  </div>
  </nav>
 </body>
